# -*- coding: utf-8 -*-
from naoqi import qi
import numpy as np

class Motion():
    def __init__(self,mot):
        self.motion_ser=mot
    def move_init(self,x,y):
        '''
        首次运动
        :param x:
        :type x:
        :param y:
        :type y:
        :return:
        :rtype:
        '''

        #初始化运动步态
        self.motion_ser.moveInit()
        #低头
        self.motion_ser.setAngles(["HeadYaw", "HeadPitch"], [0, np.pi / 7], 0.2)
        # 开始运动，xy为标准化的速度，0为无速度，1为满速度

        self.motion_ser.moveToward(x,y,0)
    def move_ractify(self,x,y,theta):
        '''
        后续修正。
        :param x:
        :type x:
        :param y:
        :type y:
        :param theta:
        :type theta:
        :return:
        :rtype:
        '''
        self.motion_ser.moveToward(x,y,theta)
    def move_stop(self):
        self.motion_ser.stopMove()
    def move_continue(self,theta):
        self.motion_ser.moveToward(0.3,0,theta)
